package com.mingweicai.intergration;

//import org.mybatis.spring.annotation.MapperScan;

import com.mingweicai.intergration.redis.cluster.configuration.RedisClusterProperties;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.prometheus.PrometheusConfig;
import io.micrometer.prometheus.PrometheusMeterRegistry;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@SpringBootApplication
//@MapperScan(basePackages = "com.xingyuan.taobaoke.dao.mapper")
@EnableScheduling
//@EnableConfigurationProperties(RedisClusterProperties.class)
public class Application extends SpringBootServletInitializer {

    private static final Logger logger = LoggerFactory.getLogger(Application.class);

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(Application.class);
    }

    @Bean(name = "meter")
    public MeterRegistry meterRegistry() {

        return new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
    }


    public static void main(String args[]){
        SpringApplication.run(Application.class, args);
    }

}
